package com.example.book_system.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.book_system.config.BookConfig;

/**
 * 借阅记录
 * 借阅者 借阅书籍的isbn 借阅时间 还书时间 是否归还 期限归还 罚款
 * @author BlueRose
 */
@TableName("history")
public class ReadHistory {
    private String id;
    private String isbn;
    private String begin;
    private String end;
    private String returned;
    private int max;
    private double punish;

    private String name;
    public ReadHistory(String id, String isbn, String begin, String end, String returned, int max, double punish, String name) {
        this.id = id;
        this.isbn = isbn;
        this.begin = begin;
        this.end = end;
        this.returned = returned;
        this.max = max;
        this.punish = punish;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ReadHistory(String id, String isbn, String begin, int max, String name) {
        this.id = id;
        this.isbn = isbn;
        this.begin = begin;
        this.returned = BookConfig.NOT_RETURNED;
        this.max = max;
        this.punish = 0;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getBegin() {
        return begin;
    }

    public void setBegin(String begin) {
        this.begin = begin;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    public String getReturned() {
        return returned;
    }

    public void setReturned(String returned) {
        this.returned = returned;
    }

    public int getMax() {
        return max;
    }

    public void setMax(int max) {
        this.max = max;
    }

    public double getPunish() {
        return punish;
    }

    public void setPunish(double punish) {
        this.punish = punish;
    }

    @Override
    public String toString() {
        return "ReadHistory{" +
                "id=" + id +
                ", isbn='" + isbn + '\'' +
                ", begin='" + begin + '\'' +
                '}';
    }
}
